home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Utils / GParted Live CD / Bin / gparted-livecd-0.2.2.iso / fake / needwrite / etc / rc.d / init.d / setclock < prev    next >
Encoding:
Text File  |  2006-01-27  |  745 b   |  45 lines

  1. #!/bin/sh
  2. # Begin $rc_base/init.d/setclock - Setting Linux Clock
  3.  
  4. # Based on setclock script from LFS-3.1 and earlier.
  5. # Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
  6.  
  7. . /etc/sysconfig/rc
  8. . $rc_functions
  9. . /etc/sysconfig/clock
  10.  
  11. CLOCKPARAMS=
  12.  
  13. case "$UTC" in
  14.     yes|true|1)
  15.         CLOCKPARAMS="$CLOCKPARAMS --utc"
  16.         ;;
  17.  
  18.     no|false|0)
  19.         CLOCKPARAMS="$CLOCKPARAMS --localtime"
  20.         ;;
  21.  
  22. esac
  23.  
  24. case $1 in
  25.     start)
  26.         echo -n -e '\E[32mSetting system clock'
  27.                 echo ""
  28.         hwclock --hctosys $CLOCKPARAMS
  29.         #evaluate_retval
  30.         ;;
  31.  
  32.     stop)
  33.         echo -n -e '\E[32mSetting hardware clock'
  34.                 echo ""
  35.         hwclock --systohc $CLOCKPARAMS
  36.         #evaluate_retval
  37.         ;;
  38.  
  39.     *)
  40.         echo -n -e '\E[32mUsage: $0 {start}'
  41.                 echo ""
  42.         ;;
  43.  
  44. esac
  45.